﻿using Microsoft.AspNetCore.Mvc;

using SqlSugar;
using Swashbuckle.AspNetCore.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using VM.Entity.EntityMap.Files;
using static Dm.net.buffer.ByteArrayBuffer;
using System.ComponentModel.DataAnnotations;
using System.Xml.Serialization;
using VM.Common.EntityEnum;
using VM.Entity.EntityMap.Title;

namespace VM.Entity.EntityDto.TitleDto
{
    /// <summary>
    /// 文章
    /// </summary>
    public class titleListDto
    {

        #region Model
        private int? _id;
        private int? _createuserid;
        private DateTime _createdate;
        private int? _updateuserid;
        private DateTime _updatedate;
        private string _description;
        private int? _iscryptonym;
        /// <summary>
        /// 内码
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, IsOnlyIgnoreInsert = true)]
        public int? id
        {
            set { _id = value; }
            get { return _id; }
        }

        /// <summary>
        /// 单据状态 1 草稿  2发布
        /// </summary>
        public int businessStatus { get; set; }


        /// <summary>
        /// 创建人
        /// </summary>

        public int? createUserId
        {
            set { _createuserid = value; }
            get { return _createuserid; }
        }

        //public string createUserName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>

        public DateTime createDate
        {
            set { _createdate = value; }
            get { return _createdate; }
        }
        /// <summary>
        /// 更新人
        /// </summary>

        public int? UpdateUserId
        {
            set { _updateuserid = value; }
            get { return _updateuserid; }
        }

        //public int UpdateUserName { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>

        public DateTime UpdateDate
        {
            set { _updatedate = value; }
            get { return _updatedate; }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string Description
        {
            set { _description = value; }
            get { return _description; }
        }
        /// <summary>
        /// 是否匿名  1是  0 否  
        /// </summary>
        public int? isCryptonym
        {
            set { _iscryptonym = value; }
            get { return _iscryptonym; }
        }

        public string isCryptonymName
        {
            get
            {
                if (isCryptonym == 1)
                {
                    return "是";
                }

                else
                {
                    return "否";

                }
            }
        }

        /// <summary>
        /// 类型，1 报好价，2发笔记， 3 发文章
        /// </summary>
        public int? typeId { get; set; }
        public string typeName
        {
            get
            {
                if (typeId == 1)
                {
                    return "报好价";
                }
                else if (typeId == 2)
                {
                    return "发笔记";
                }
                else if (typeId == 2)
                {
                    return "发文章";

                }
                else
                {
                    return "错误分类";
                }
            }
        }


        /// <summary>
        /// 主要信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(sys_titleMainInfo.parentId), nameof(id))]
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        public titleMainInfoDto main { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        [Navigate(NavigateType.OneToMany, nameof(sys_fileLog.parentId), nameof(id))]//BookA表中的studenId
        public List<sys_fileLog>? files { get; set; }

        /// <summary>
        /// 话题
        /// </summary>
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        [Navigate(NavigateType.OneToMany, nameof(sys_titleTopic.parentId), nameof(id))]//BookA表中的studenId
        public List<titleTopicDto>? topic { get; set; }



        #endregion Model

    }
}
